package com.haoyeteng.sxbd.modular.fdc.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.haoyeteng.sxbd.modular.business.dao.FDCUserMapper;
import com.haoyeteng.sxbd.modular.fdc.pojo.Users;
import com.haoyeteng.sxbd.modular.fdc.service.IFDCUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 用户表 服务实现类
 * </p>
 *
 * @author haoyeteng123
 * @since 2019-05-16
 */
@Service
public class FDCUserServiceImpl extends ServiceImpl<FDCUserMapper, Users> implements IFDCUserService{

	@Autowired
	private FDCUserMapper userMapper;


	@Override
	public List<Map<String, Object>> selectUsersAndAuth(Page<Users> page,Map<String,Object> params) {
		return userMapper.selectFDCUsers(page,params);
	}

	@Override
	public Users selectAndDtlById(long id) {
		return userMapper.selectById(id);
	}

	@Override
	public void updateUsers(Users users) {
		users.setUpdateTime(new Date());
		userMapper.updateById(users);
	}

	@Override
	public void insertUser(Users users) {
		users.setCreateTime(new Date());
		userMapper.insert(users);

	}

	@Override
	public Users selectUserByPhone(String phone) {
		return userMapper.getByUserPhone(phone);
	}
}
